package com.lvkerry.ssm.service.impl;


import com.lvkerry.ssm.dao.UserDao;
import com.lvkerry.ssm.domain.User;
import com.lvkerry.ssm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author KerryZhang
 */

@Service("userService")
public class UserServiceImpl implements UserService {

    private final UserDao userDao;

    @Autowired
    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }


    @Override
    public int addUser(User t) {
        return userDao.addUser(t);
    }

    @Override
    public int removeUser(User t) {
        return userDao.removeUser(t);
    }

    @Override
    public int updateUser(User t) {
        return userDao.updateUser(t);
    }



    @Override
    public User findUserById(String id) {
        return userDao.findUserById(id);
    }

    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }
}
